#include<stdio.h>

double matrixAvg(int M, int N, double (*b)[N])
{
    double ave, sum = 0;

    for (int i = 0; i < M; i++)
    {
        for (int j = 0; j < N; j++)
        {
            sum += *(*(b+i)+j);
        }
    }
    
    ave = sum/(M*N);
    return ave;
}

int main(){

	int M,N;

	scanf("%d%d",&M,&N);

	double aver,a[M][N];

	int i,j;

	for(i=0;i<M;i++)

		for(j=0;j<N;j++)

			scanf("%lf",&a[i][j]);

        aver=matrixAvg(M,N,a);

	printf("%.2f\n",aver);

	return 0;

}